@extends('layouts.app')
@include('system.sidebar')
@section('content')
    <div class="content">
        <div class="row custom-invoice">
            @can('system-edit')
                <a class="btn btn-success" href="{{ route('admin.system.banner.create') }}">添加图片</a>
                <br />
                <br />
            @endcan
            <table class="table table-striped table-hover">
                <thead>
                <tr>
                    <th>图片</th>
                    <th>排序权重</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                @foreach($data as $item)
                    <tr>
                        <td>
                            <img src="{{ \App\Library\OSS::instance()->getUrl($item->image) }}" width="300">
                        </td>
                        <td>{{ $item->sort }}</td>
                        <td>
                            @can('system-edit')
                                <a class="btn btn-primary btn-xs" data-method="delete" data-confirm="删除后不能恢复，确定删除吗？" href="{{ route('admin.system.banner.delete', ['id' => $item->id]) }}"><i class="fa fa-trash-o"></i> 删除</a>
                            @endcan
                        </td>
                    </tr>
                @endforeach
                </tbody>
            </table>
        </div>
    </div>
@endsection
@push('scripts')
@endpush
